/***********************************************************************
 * Module:  Modele.java
 * Author:  a.kanwar
 * Purpose: Defines the Class Modele
 ***********************************************************************/

import java.util.*;


public class Modele {
 
    /******************************************************************
     * Attribute
     ******************************************************************/
    
    private int idModele;
    private java.lang.String libelle;
    private Marque marque;
       

    /******************************************************************
     * Constructor
     ******************************************************************/
    public Modele(int idModele, String libelle, Marque marque) {
        this.idModele = idModele;
        this.libelle = libelle;
        this.marque = marque;
    }

    public Modele(String libelle, Marque marque) {
        this.libelle = libelle;
        this.marque = marque;
    }

    /******************************************************************
     * getters and setters
     ******************************************************************/
    public int getIdModele() {
        return idModele;
    }

    public void setIdModele(int idModele) {
        this.idModele = idModele;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    @Override
    public String toString() {
        return "Modele{" + "idModele=" + idModele + ", libelle=" + libelle + ", marque=" + marque + '}';
    }

    
    /*****************************************************************
     * generate code by power AMC
     *****************************************************************/
    
    
    
   /** @pdGenerated default parent getter */
   public Marque getMarque() {
      return marque;
   }
   
   /** @pdGenerated default parent setter
     * @param newMarque */
   public void setMarque(Marque newMarque) {
      if (this.marque == null || !this.marque.equals(newMarque))
      {
         if (this.marque != null)
         {
            Marque oldMarque = this.marque;
            this.marque = null;
            oldMarque.removeModele(this);
         }
         if (newMarque != null)
         {
            this.marque = newMarque;
            this.marque.addModele(this);
         }
      }
   }

}